import Taro from '@tarojs/taro';
import api from 'api';

async function getAntApiKey() {
  const antApiKey = await api.AntApiController.getAntApi();
  console.log(antApiKey, antApiKey.length > 0, antApiKey[0].configDTO.apiKey);
  if (antApiKey && antApiKey.length > 0 && antApiKey[0].configDTO.apiKey) {
    return antApiKey[0].configDTO.apiKey;
  } else {
    Taro.showToast({
      title: '请求数据失败,请稍后重试',
      icon: 'none',
    });
    throw new Error('get AntKeyError');
  }
}
export default {getAntApiKey};
